import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

// import PageTools from '@/components/employees'
// Vue.component('PageTools', PageTools)

// 自定义插件
import myPlugin from '@/components/index'
// 注册插件
Vue.use(myPlugin)

import Print from 'vue-print-nb'
Vue.use(Print)

// 自定义指令
import * as directives from './directives'
// console.log(directives)
// console.log(Object.keys(directives))
Object.keys(directives).forEach(key => {
  Vue.directive(key, directives[key].inserted)
})

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

import i18n from './lang'

Vue.config.productionTip = false

new Vue({
  el: '#app',
  i18n,
  router,
  store,
  render: h => h(App)
})
